use super::hitls_pki_types::{HITLS_PKI_LibCtx, HITLS_X509_SignAlgParam};
use crate::bsl::bsl_list::BslList;
use crate::bsl::bsl_types::BSL_Buffer;
use crate::crypto::crypt_algid::CRYPT_MD_AlgId;
use crate::crypto::crypt_eal_pkey::CRYPT_EAL_PkeyCtx;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _HITLS_X509_Cert {
    _unused: [u8; 0],
}
pub type HITLS_X509_Cert = _HITLS_X509_Cert;
unsafe extern "C" {
    pub fn HITLS_X509_CertNew() -> *mut HITLS_X509_Cert;
}
unsafe extern "C" {
    pub fn HITLS_X509_ProviderCertNew(
        libCtx: *mut HITLS_PKI_LibCtx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_X509_Cert;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertFree(cert: *mut HITLS_X509_Cert);
}
unsafe extern "C" {
    pub fn HITLS_X509_CertDup(src: *mut HITLS_X509_Cert) -> *mut HITLS_X509_Cert;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertSign(
        mdId: i32,
        prvKey: *const CRYPT_EAL_PkeyCtx,
        algParam: *const HITLS_X509_SignAlgParam,
        cert: *mut HITLS_X509_Cert,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertDigest(
        cert: *mut HITLS_X509_Cert,
        mdId: CRYPT_MD_AlgId,
        data: *mut u8,
        dataLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertCtrl(
        cert: *mut HITLS_X509_Cert,
        cmd: i32,
        val: *mut ::std::os::raw::c_void,
        valLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertParseBuff(
        format: i32,
        encode: *const BSL_Buffer,
        cert: *mut *mut HITLS_X509_Cert,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_ProviderCertParseBuff(
        libCtx: *mut HITLS_PKI_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        format: *const ::std::os::raw::c_char,
        encode: *const BSL_Buffer,
        cert: *mut *mut HITLS_X509_Cert,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertParseBundleBuff(
        format: i32,
        encode: *const BSL_Buffer,
        certlist: *mut *mut BslList,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_ProviderCertParseBundleBuff(
        libCtx: *mut HITLS_PKI_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        format: *const ::std::os::raw::c_char,
        encode: *const BSL_Buffer,
        certlist: *mut *mut BslList,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertParseFile(
        format: i32,
        path: *const ::std::os::raw::c_char,
        cert: *mut *mut HITLS_X509_Cert,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_ProviderCertParseFile(
        libCtx: *mut HITLS_PKI_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        format: *const ::std::os::raw::c_char,
        path: *const ::std::os::raw::c_char,
        cert: *mut *mut HITLS_X509_Cert,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertParseBundleFile(
        format: i32,
        path: *const ::std::os::raw::c_char,
        certlist: *mut *mut BslList,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_ProviderCertParseBundleFile(
        libCtx: *mut HITLS_PKI_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        format: *const ::std::os::raw::c_char,
        path: *const ::std::os::raw::c_char,
        certlist: *mut *mut BslList,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertGenBuff(
        format: i32,
        cert: *mut HITLS_X509_Cert,
        buff: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_X509_CertGenFile(
        format: i32,
        cert: *mut HITLS_X509_Cert,
        path: *const ::std::os::raw::c_char,
    ) -> i32;
}